Skip to content

Move appearance ref definition outside useAppearance() #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nckrtl
Copy link

@nckrtl nckrtl commented Apr 28, 2025

The appearance ref is currently scoped within the useAppearance composable. Meaning that whenever you import the useAppearance composable a new appearance ref instance will be created. When you need the appearance in multiple places in your app you'll end up with different appearance instances, while its useful if the appearance instance would be the same/stay in sync between all components where it's used.

Moving the appearance definition outside useAppearance resolves this, resulting in the same appearance instance being returned when importing it like:

import { useAppearance } from "@/Composables/useAppearance";

const { appearance } = useAppearance();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant